package com.example.controller;

import com.example.common.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class Webcontroller {

    @GetMapping("/hello")
    public Result hello() {
        return Result.success("Hello 陈安鸿");

    }
    @GetMapping("/weather")
    public Result weather() {
        return Result.success("天气晴");
    }
    @GetMapping("/count")
    public Result count(){
        return  Result.success(10);
    }
    @GetMapping("/map")
    public Result map() {
        HashMap<String,Object> map = new HashMap<>();
        map.put("name","陈安鸿");
        map.put("age",20);
        return Result.success(map);
    }
}